From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes@ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock@40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock@40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue Mar 14 23:22:04 2006 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces@qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes@ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue Mar 28 18:25:28 2006 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock@40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock@40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue Mar 28 18:25:29 2006 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces@qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes@ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx@qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock@40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock@40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue Mar 28 20:17:23 2006 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces@qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx@qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > > 1.5 on a Windows XP machine. I also have a serial device that contains >a > > buffer of (supposedly) hex data. > > > > I just want to make sure that I'm communicating with the device >properly, so > > I'm running a modified version of SimpleRead.java (the JavaComm example >you > > might recognize - found here: > > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > > changed the import line to use "gnu.io.*" and set the port name to COM1. > I > > don't know a ton about the device yet (I'm waiting on more details from >the > > manufacturer), but I thought I'd at least be able to read some data from >it. > > > > Everything seems to run fine, except that the program never quits! I >have > > to hit cntrl-c to exit. I added a number of print lines (the output is > > below), and the read thread is apparently waking up. It's been a while > > since I've used Java, but I thought the program was supposed to end when >the > > thread and main function finished ;) Something is apparently blocking >or > > frozen - any ideas? Here's the output from my program: > > > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > > Devel Library > > ========================================= > > Native lib Version = RXTX-2.1-7pre17 > > Java lib Version = RXTX-2.1-7pre17 > > Inside while loop... > > Found port: COM1 > > Opened serial port... > > Obtained input stream... > > Added event listener... > > Set port parameters... > > isRTS: false > > isCTS: false > > isDSR: true > > isDTR: false > > isRI: false > > isCD: false > > flowControlMode: 0 > > Inside while loop... > > - thread running - > > - finished sleeping - > > > > If I should post the full source code for this class, just let me know. >I'd > > appreciate any help - thanks a lot! > > > > -Richard > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From rybskej at yahoo.com Tue Dec 6 12:42:33 2005 From: rybskej at yahoo.com (Eric Rybski) Date: Tue, 6 Dec 2005 11:42:33 -0800 (PST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() Message-ID: <20051206194233.82473.qmail@web60516.mail.yahoo.com> All, I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 because of end-of-life support on Windows, which my team requires for development of some of our Java applications that use serial communication. I am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP Pro. A discrepancy I have immediately found between Sun's Win32Serial and RXTXCommDriver for serial port communication is a java.io.IOException: Input/output error in writeArray when I try to write an array of bytes with 0 length. Win32Serial handles this case apparently by not writing anything to the output stream and returning, so no exception is thrown. For example, given a class that implements javax.comm.SerialPortEventListener, consider the following code snippet: // --------------------------------------------------------------------- CommPortIdentifier portId; try { portId = CommPortIdentifier.getPortIdentifier(port); } catch (NoSuchPortException e) {} serialPort = (SerialPort) portId.open(portOwner, 2000); [... other serial port config here ...] String text = new String(""); try { serialPort.getOutputStream().write(text.getBytes()); } catch (IOException e) {} // --------------------------------------------------------------------- When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get an IOException. Obviously, if I were to validate the length of the input before calling write(), I would not run into this issue (which is what I've just done this afternoon in my application). Thus, is this behavior deliberate or is it considered a bug? I'm not advocating that RxTx should be able to handle a 0-length byte array without throwing an exception, but it does deviate from the expected behavior of JavaComm. Does anyone have any advice over whether this is a known bug in RxTx, or if it is not, if it is already patched in the 2.1x series of RxTx or if I should report it as a bug? Regards, Eric From tjarvi at qbang.org Tue Dec 6 20:51:40 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:51:40 -0700 (MST) Subject: [Rxtx] Problem using some native methods in RXTX comapi. In-Reply-To: References: Message-ID: On Tue, 6 Dec 2005, Vinayak Ghate wrote: > Hi all, > I have installed comm api for java from RXTX package > (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having > Linux as OS (Red Hat Linux Release 9 distribution). > I have installed the RXTX com apis as mentioned in the install document. But > when I run the application which is checking how many serial and parallel > ports are available in the system, it gives the following core dump. > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4000972A > Function=_dl_relocate_object+0x6A > Library=/lib/ld-linux.so.2 > > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > - locked <0x44690270> (a java.util.Vector) > - locked <0x446abd80> (a java.util.Vector) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > - locked <0x446a4bf0> (a java.lang.Runtime) > at java.lang.System.loadLibrary(System.java:834) > at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) > at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) > at ListPorts.main(ListPorts.java:6) > I'm not sure what is going on here but you do mention using a legacy linux system (rhat 9). I would do two things. Compile rxtx on that system and make sure the jre you are using is either certified on the version/distro of linux you have or drop back to the releases that came out about when the linux distro you are using was released. The function error suggests something on a gross error level like the library not being compatable with ld.so. I'd try compiling rxtx yourself and trying that native library. Sometimes binaries can have backwards compatability problems. From tjarvi at qbang.org Tue Dec 6 20:57:56 2005 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 6 Dec 2005 20:57:56 -0700 (MST) Subject: [Rxtx] java.io.IOException with SerialPortEventListener and OutputStream write() In-Reply-To: <20051206194233.82473.qmail@web60516.mail.yahoo.com> References: <20051206194233.82473.qmail@web60516.mail.yahoo.com> Message-ID: On Tue, 6 Dec 2005, Eric Rybski wrote: > All, > > I recently switched my application to use RxTx instead of Sun's JavaComm 2.0 > because of end-of-life support on Windows, which my team requires for > development of some of our Java applications that use serial communication. I > am using RXTX-2.0-7pre1 with Sun's Solaris comm.java and JRE 1.3.1_16 on WinXP > Pro. > > A discrepancy I have immediately found between Sun's Win32Serial and > RXTXCommDriver for serial port communication is a > > java.io.IOException: Input/output error in writeArray > > when I try to write an array of bytes with 0 length. Win32Serial handles this > case apparently by not writing anything to the output stream and returning, so > no exception is thrown. > > For example, given a class that implements javax.comm.SerialPortEventListener, > consider the following code snippet: > // --------------------------------------------------------------------- > CommPortIdentifier portId; > try { > portId = CommPortIdentifier.getPortIdentifier(port); > } > catch (NoSuchPortException e) {} > serialPort = (SerialPort) portId.open(portOwner, 2000); > [... other serial port config here ...] > String text = new String(""); > try { > serialPort.getOutputStream().write(text.getBytes()); > } > catch (IOException e) {} > // --------------------------------------------------------------------- > > When using Win32Serial, no exception occurs; when using RXTXCommDriver, I get > an IOException. Obviously, if I were to validate the length of the input > before calling write(), I would not run into this issue (which is what I've > just done this afternoon in my application). > > Thus, is this behavior deliberate or is it considered a bug? I'm not > advocating that RxTx should be able to handle a 0-length byte array without > throwing an exception, but it does deviate from the expected behavior of > JavaComm. > > Does anyone have any advice over whether this is a known bug in RxTx, or if it > is not, if it is already patched in the 2.1x series of RxTx or if I should > report it as a bug? > We can switch the behavior to be more like Sun's. It can even be done in RXTXPort.java. I'm leaving for a red eye flight tonight so I'm not going to get to it for a while. If you put a patch together it would be better as you can test it before we put it in. Just remember when doing patches to have one patch per change and post them here for review. Often I reject hairball patches sent off the list. Let everyone review them in an easily readable context. "This patch matches Sun's write behavior with 0 bytes." Usually these issues are just because we didnt see the expected behavior documented. RXTX was made to match the documentated API. From nigel.magnay at gmail.com Sun Dec 11 16:06:22 2005 From: nigel.magnay at gmail.com (Nigel Magnay) Date: Sun, 11 Dec 2005 23:06:22 +0000 Subject: [Rxtx] rxtx and arm linux problem Message-ID: <320075ff0512111506i16b2f585x@mail.gmail.com> Hi there I am trying to use rxtx on an ARM linux board, which I have put Blackdown-1.3.1 I'm using the source rxtx-2.0-7pre1; The comment on the binaries page says source for pre2 is only for late 1.4 and current 1.5 JREs, so I'm assuming I can't use that? I have to cross compile from an x86 machine - I couldn't get the default makefiles to generate the correct .so files with this, so I did the last part by hand (I.E arm-linux-gcc -shared -Wl,-soname,librxtxSerial.so -o librxtxSerial.so SerialImpl.lo -lc) So far so good - it starts executing, but I am getting a SIGSEGV fault in testRead - I'm a bit stumped as what to try next - am I using a version that should work, or are there other things I should maybe try? The versions of libpthread in /lib seems to be -0.10.so, so that sounds OK ? Output from file: Devel Library ========================================= Native lib Version = RXTX-2.0-7pre1 Java lib Version = RXTX-2.0-7pre1 pc : [<401208dc>] lr : [<400216f8>] Not tainted sp : bfffd1b4 ip : 00000000 fp : bfffd1e4 r10: 40130dfc r9 : 0000000d r8 : 0000000d r7 : bfa00000 r6 : 00000001 r5 : 00000000 r4 : 00000000 r3 : 000001f8 r2 : 40034e10 r1 : bfa00000 r0 : 0001c214 Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user Control: C000717F Table: 0525C000 DAC: 00000015 SIGSEGV 11* segmentation violation si_signo [11]: SIGSEGV 11* segmentation violation si_errno [0]: Success si_code [1]: SEGV_MAPERR [addr: 0x1] stackpointer=0xbfffd028 Full thread dump Classic VM (Blackdown-1.3.1-RC1, native threads): "Finalizer" (TID:0x40f93528, sys_thread_t:0x61f30, state:CW, native ID:0xc004) prio=8 at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:108) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:123) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:162) "Reference Handler" (TID:0x40f93300, sys_thread_t:0x5b008, state:CW, native ID:0x8003) prio=10 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:110) "Signal Dispatcher" (TID:0x40f93330, sys_thread_t:0x59e58, state:CW, native ID:0x4002) prio=5 "main" (TID:0x40f931b0, sys_thread_t:0x1be78, state:R, native ID:0x4000) prio=5 at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:274) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:774) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:330) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:166) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at com.coproca.avx.audiometer.app.MainApp.listPortChoices(MainApp.java:93) at com.coproca.avx.audiometer.app.MainApp.main(MainApp.java:69) Monitor Cache Dump: java.lang.ref.ReferenceQueue$Lock at 40F93540/40FC9838: Waiting to be notified: "Finalizer" (0x61f30) java.lang.ref.Reference$Lock at 40F93310/40FC9340: Waiting to be notified: "Reference Handler" (0x5b008) Registered Monitor Dump: utf8 hash table: JNI pinning lock: JNI global reference lock: BinClass lock: Class linking lock: System class loader lock: Code rewrite lock: Heap lock: Monitor cache lock: owner "main" (0x1be78) 1 entry Thread queue lock: owner "main" (0x1be78) 1 entry Monitor registry: owner "main" (0x1be78) 1 entry From christopher.dawes at the-logic-group.com Tue Dec 6 02:17:44 2005 From: christopher.dawes at the-logic-group.com (christopher.dawes@the-logic-group.com) Date: Tue, 6 Dec 2005 09:17:44 +0000 Subject: [Rxtx] Help getting started In-Reply-To: Message-ID: Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ rxtx-bounces at qbang.org wrote on 06/12/2005 01:11:08: > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From rtc_web at hotmail.com Mon Dec 5 18:11:08 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Mon, 05 Dec 2005 17:11:08 -0800 Subject: [Rxtx] Help getting started Message-ID: Hi - I'm having some trouble getting started with serial communications, and I was hoping someone here could help me out. I'm using RXTX 2.1 and Java 1.5 on a Windows XP machine. I also have a serial device that contains a buffer of (supposedly) hex data. I just want to make sure that I'm communicating with the device properly, so I'm running a modified version of SimpleRead.java (the JavaComm example you might recognize - found here: http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've changed the import line to use "gnu.io.*" and set the port name to COM1. I don't know a ton about the device yet (I'm waiting on more details from the manufacturer), but I thought I'd at least be able to read some data from it. Everything seems to run fine, except that the program never quits! I have to hit cntrl-c to exit. I added a number of print lines (the output is below), and the read thread is apparently waking up. It's been a while since I've used Java, but I thought the program was supposed to end when the thread and main function finished ;) Something is apparently blocking or frozen - any ideas? Here's the output from my program: C:\_code\Java\SerialTest>java -classpath "." SimpleRead Devel Library ========================================= Native lib Version = RXTX-2.1-7pre17 Java lib Version = RXTX-2.1-7pre17 Inside while loop... Found port: COM1 Opened serial port... Obtained input stream... Added event listener... Set port parameters... isRTS: false isCTS: false isDSR: true isDTR: false isRI: false isCD: false flowControlMode: 0 Inside while loop... - thread running - - finished sleeping - If I should post the full source code for this class, just let me know. I'd appreciate any help - thanks a lot! -Richard _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ From Christopher.Dawes at ants.me.uk Tue Dec 6 02:21:41 2005 From: Christopher.Dawes at ants.me.uk (Christopher.Dawes@ants.me.uk) Date: Tue, 6 Dec 2005 09:21:41 +0000 Subject: [Rxtx] Help getting started In-Reply-To: References: Message-ID: <1133860901.439558257b094@webmail.freedom2surf.net> Hello, do you call serialPort.close(); when you "> - finished sleeping -"? If you shove the source code online i can take a look. Christopher ------------------------------------------- Consultant Engineer The Logic Group Fleet GU51 3TZ Quoting Richard Colvin : > Hi - I'm having some trouble getting started with serial communications, and > I was hoping someone here could help me out. I'm using RXTX 2.1 and Java > 1.5 on a Windows XP machine. I also have a serial device that contains a > buffer of (supposedly) hex data. > > I just want to make sure that I'm communicating with the device properly, so > I'm running a modified version of SimpleRead.java (the JavaComm example you > might recognize - found here: > http://java.sun.com/developer/releases/javacomm/SimpleRead.java). I've > changed the import line to use "gnu.io.*" and set the port name to COM1. I > don't know a ton about the device yet (I'm waiting on more details from the > manufacturer), but I thought I'd at least be able to read some data from it. > > Everything seems to run fine, except that the program never quits! I have > to hit cntrl-c to exit. I added a number of print lines (the output is > below), and the read thread is apparently waking up. It's been a while > since I've used Java, but I thought the program was supposed to end when the > thread and main function finished ;) Something is apparently blocking or > frozen - any ideas? Here's the output from my program: > > C:\_code\Java\SerialTest>java -classpath "." SimpleRead > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre17 > Java lib Version = RXTX-2.1-7pre17 > Inside while loop... > Found port: COM1 > Opened serial port... > Obtained input stream... > Added event listener... > Set port parameters... > isRTS: false > isCTS: false > isDSR: true > isDTR: false > isRI: false > isCD: false > flowControlMode: 0 > Inside while loop... > - thread running - > - finished sleeping - > > If I should post the full source code for this class, just let me know. I'd > appreciate any help - thanks a lot! > > -Richard > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From mdasht2004 at yahoo.com Tue Dec 6 04:42:30 2005 From: mdasht2004 at yahoo.com (mdasht) Date: Tue, 6 Dec 2005 03:42:30 -0800 (PST) Subject: [Rxtx] CommPortIdentifier.getPortIdentifier Hang Message-ID: <20051206114230.3731.qmail@web50006.mail.yahoo.com> Hi, I'm using rxtx-2.1-7pre17 (without Sun's CommAPI, namespace gnu.io) in Redhat Linux 9.0, jdk1.5.0_03. My application communicates via Serial Port. There is another application which uses parallel port. when this application is running, my application hangs on CommPortIdentifier.getPortIdentifier("/dev/ttyS0"); or CommPortIdentifier.getPortIdentifiers(); line. but when that application is stopped my application runs and works very well. any suggestion to solve my problem? Regards, mdasht. __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com From vinayak.ghate at softdel.com Tue Dec 6 05:19:01 2005 From: vinayak.ghate at softdel.com (Vinayak Ghate) Date: Tue, 6 Dec 2005 17:49:01 +0530 Subject: [Rxtx] Problem using some native methods in RXTX comapi. Message-ID: Hi all, I have installed comm api for java from RXTX package (rxtx-2.0-7pre1-i686-pc-linux-gnu.tar.gz) on my host pc (x86 based) having Linux as OS (Red Hat Linux Release 9 distribution). I have installed the RXTX com apis as mentioned in the install document. But when I run the application which is checking how many serial and parallel ports are available in the system, it gives the following core dump. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4000972A Function=_dl_relocate_object+0x6A Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44690270> (a java.util.Vector) - locked <0x446abd80> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x446a4bf0> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:237) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:109) at ListPorts.main(ListPorts.java:6) Dynamic libraries: 08048000-08057000 r-xp 00000000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 08057000-08059000 rw-p 0000e000 16:02 1052236 /home/vinay/jvm/i386/j2sdk1.4.2/bin/java 40000000-40015000 r-xp 00000000 16:01 551657 /lib/ld-2.3.2.so 40015000-40016000 rw-p 00014000 16:01 551657 /lib/ld-2.3.2.so 40017000-4001f000 r-xp 00000000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 4001f000-40020000 rw-p 00007000 16:02 249222 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so 40022000-4002c000 r-xp 00000000 16:01 535451 /lib/tls/libpthread-0.29.so 4002c000-4002d000 rw-p 0000a000 16:01 535451 /lib/tls/libpthread-0.29.so 4002f000-40031000 r-xp 00000000 16:01 551668 /lib/libdl-2.3.2.so 40031000-40032000 rw-p 00002000 16:01 551668 /lib/libdl-2.3.2.so 40033000-402e8000 r-xp 00000000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 402e8000-40301000 rw-p 002b5000 16:02 117867 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/client/libjvm.so 40314000-40326000 r-xp 00000000 16:01 551672 /lib/libnsl-2.3.2.so 40326000-40327000 rw-p 00011000 16:01 551672 /lib/libnsl-2.3.2.so 40329000-403d2000 r-xp 00000000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403d2000-403d7000 rw-p 000a9000 16:01 357151 /usr/lib/libstdc++.so.5.0.3 403dc000-403fd000 r-xp 00000000 16:01 535449 /lib/tls/libm-2.3.2.so 403fd000-403fe000 rw-p 00020000 16:01 535449 /lib/tls/libm-2.3.2.so 403fe000-40405000 r-xp 00000000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40405000-40406000 rw-p 00007000 16:01 551712 /lib/libgcc_s-3.2.2-20030225.so.1 40406000-4040a000 rw-s 00000000 16:01 1201947 /tmp/hsperfdata_vinay/5928 4040a000-4040d000 r--s 00000000 16:02 1150564 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/dnsns.jar 40411000-4041c000 r-xp 00000000 16:01 551678 /lib/libnss_files-2.3.2.so 4041c000-4041d000 rw-p 0000a000 16:01 551678 /lib/libnss_files-2.3.2.so 4041d000-4042e000 r-xp 00000000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042e000-4042f000 rw-p 00011000 16:02 2297448 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libverify.so 4042f000-4044e000 r-xp 00000000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044e000-4044f000 rw-p 0001f000 16:02 2297446 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libjava.so 4044f000-40460000 r-xp 00000000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40460000-40462000 rw-p 00011000 16:02 2297456 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/libzip.so 40462000-41e08000 r--s 00000000 16:02 1642096 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/rt.jar 41e52000-41e68000 r--s 00000000 16:02 1642090 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/sunrsasign.jar 41e68000-41f45000 r--s 00000000 16:02 1642060 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jsse.jar 41f45000-41f56000 r--s 00000000 16:02 1642071 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/jce.jar 42000000-4212e000 r-xp 00000000 16:01 535447 /lib/tls/libc-2.3.2.so 4212e000-42131000 rw-p 0012e000 16:01 535447 /lib/tls/libc-2.3.2.so 42133000-4268c000 r--s 00000000 16:02 1642080 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/charsets.jar 4c890000-4ca90000 r--p 00000000 16:01 470509 /usr/lib/locale/locale-archive 4cc90000-4ccac000 r--s 00000000 16:02 1150565 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar 4ccac000-4ccb3000 r--s 00000000 16:02 1150566 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/RXTXcomm.jar 4ccb3000-4ccc1000 r--s 00000000 16:02 1150567 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/ldapsec.jar 4ccc1000-4cd7d000 r--s 00000000 16:02 1150570 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/localedata.jar 4cd7d000-4cd9b000 r--s 00000000 16:02 1068708 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm.jar 4cd9b000-4cdb8000 r--s 00000000 16:02 1150572 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/ext/comm_x86.jar 4cdb8000-4cdc2000 r-xp 00000000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc2000-4cdc3000 rw-p 00009000 16:02 2297470 /home/vinay/jvm/i386/j2sdk1.4.2/jre/lib/i386/librxtxSerial.so 4cdc3000-4cdc9000 r--s 00000000 16:01 649182 /usr/lib/gconv/gconv-modules.cache Heap at VM Abort: Heap def new generation total 576K, used 357K [0x44690000, 0x44730000, 0x44b70000) eden space 512K, 69% used [0x44690000, 0x446e94f8, 0x44710000) from space 64K, 0% used [0x44710000, 0x44710000, 0x44720000) to space 64K, 0% used [0x44720000, 0x44720000, 0x44730000) tenured generation total 1408K, used 0K [0x44b70000, 0x44cd0000, 0x48690000) the space 1408K, 0% used [0x44b70000, 0x44b70000, 0x44b70200, 0x44cd0000) compacting perm gen total 4096K, used 1203K [0x48690000, 0x48a90000, 0x4c690000) the space 4096K, 29% used [0x48690000, 0x487bcd68, 0x487bce00, 0x48a90000) Local Time = Thu Dec 1 18:02:09 2005 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (Blackdown-1.4.2-fcs mixed mode) # Can anybody explain me what is happening and what might be going wrong in this case? Thanks and regard, Vinay From rtc_web at hotmail.com Tue Dec 6 08:35:38 2005 From: rtc_web at hotmail.com (Richard Colvin) Date: Tue, 06 Dec 2005 07:35:38 -0800 Subject: [Rxtx] Help getting started In-Reply-To: <1133860901.439558257b094@webmail.freedom2surf.net> Message-ID: No, I wasn't calling that. I didn't edit the sample too much, and it's funny that it wasn't already there. Anyway, I added it to the read thread after it wakes up and now the program is finishing. Thanks for your help! -Richard >From: Christopher.Dawes at ants.me.uk >Reply-To: RXTX Developers and Users >To: RXTX Developers and Users >Subject: Re: [Rxtx] Help getting started >Date: Tue, 6 Dec 2005 09:21:41 +0000 > >Hello, do you call serialPort.close(); when you "> - finished sleeping -"? >If >you shove the source code online i can take a look. > >Christopher > >------------------------------------------- >Consultant Engineer >The Logic Group >Fleet >GU51 3TZ > >Quoting Richard Colvin : > > > Hi - I'm having some trouble getting started with serial communications, >and > > I was hoping someone here could help me out. I'm using RXTX 2.1 and >Java > >